use strict;
use warnings;

my ($file, $gene) = @ARGV;
open(my $fileh, $file) or die('No conversion file.');

my @conversions = <$fileh>;
my @headers = split /,\s*/, $conversions[0];
my $headerslength = @headers;

my $uniqidcol;
my $uniprotcol;

for(my $i = 0; $i < $headerslength; $i++){
    if($headers[$i] =~ /'Probe'/){
        $uniqidcol = $i;
    }
    
    if($headers[$i] =~ /'SwissProt'/){
        $uniprotcol = $i;
    }
}

my $result = "'";

foreach my $line (@conversions){
    chomp $line;
    my @data = split /,\s*/, $line;
    if($data[$uniprotcol] =~ /$gene/){
        $result = $result . $data[$uniqidcol] .',';
    }
}

print $result;